The result of the comparison is the same, regardless of whether the constant is on the left or right-hand side. But following this convention will
help pinpoint the occasional error where =
(assignment) is substituted for ==
(comparison).
If the constant is on the right-hand side of the expression in such cases, the code will still compile and run - just not as expected. If the
constant is on the left-hand side, the error will be caught at the first attempt to compile.
Noncompliant code example
if ( var == constant )
if ( pointer == NULL )
Compliant solution
if ( constant == var )
if ( NULL == pointer )